import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login')
  },
  {
    path: '/main',
    name: 'Main',
    component: () => import('../views/Main'),
    children: [
      {
        path: '/users',
        name: 'Users',
        component: () => import('../views/user/Users')
      },
      {
        path: '/loginLog',
        name: 'LoginLog',
        component: () => import('../views/loginlog/LoginLog')
      },
      {
        path: '/welcome',
        name: 'Welcome',
        component: () => import('../views/welcome2')
      },
      {
        path: '/departments',
        name: 'Department',
        component: () => import('../views/department')
      },
      {
        path: '/swagger',
        name: 'Swagger',
        component: () => import('../views/swagger')
      },
      {
        path: '/health',
        name: 'Health',
        component: () => import('../views/health')
      },
      {
        path: '/map',
        name: 'Map',
        component: () => import('../views/map')
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})



export default router
